package countAsterisks;

public class Solution {
    public int countAsterisks(String s) {
        int t = 0;
        int ans = 0;
        for (int i = 0; i < s.length(); i++) {
            if(t%2 == 0&&s.charAt(i) == '*') {
                ans++;
            }
            if(s.charAt(i) == '|'){
                t++;
            }
        }
        return ans;
    }
}
